<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body>
<div th:fragment="alert" style="z-index:1050;">
    <div id="modal-remove" class="modal fade" >
        <div class="modal-dialog" id="deleteStrategy" th:fragment="deleteStrategy">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" data-dismiss="modal" class="close">
                        <span>&times;</span>
                    </button>
                    <h4 class="modal-title">删除当前策略</h4>
                </div>
                <div class="modal-body">
                    <p>该策略将被永久删除，且无法找回，是否继续？</p>
                </div>
                <div class="modal-footer">
                    <button id="deletedStrategyData"
                            type="button"
                            class="btn btn-primary"
                            th:value="${deletedStrategyData}"
                            onclick="deleteStrategy($('#deletedStrategyData').val())">确定</button>
                    <button type="button" data-dismiss="modal" class="btn btn-danger">取消</button>
                </div>
            </div>
        </div>
    </div>

    <div id="modal-stop" class="modal fade" >
        <div class="modal-dialog" id="stopStrategy" th:fragment="stopStrategy">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" data-dismiss="modal" class="close">
                        <span>&times;</span>
                    </button>
                    <h4 class="modal-title">停止当前策略</h4>
                </div>
                <div class="modal-body">
                    <p>该策略将被停止，是否继续？</p>
                </div>
                <div class="modal-footer">
                    <button id="stopStrategyData"
                            type="button"
                            class="btn btn-primary"
                            th:value="${stopStrategyData}"
                            onclick="stopStrategy($('#stopStrategyData').val())">确定</button>
                    <button type="button" data-dismiss="modal" class="btn btn-danger">取消</button>
                </div>
            </div>
        </div>
    </div>

    <div id="modal-start" class="modal fade" >
        <div class="modal-dialog" id="startStrategy" th:fragment="startStrategy">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" data-dismiss="modal" class="close">
                        <span>&times;</span>
                    </button>
                    <h4 class="modal-title">运行当前策略</h4>
                </div>
                <div class="modal-body">
                    <p>将执行该策略，是否继续？</p>
                </div>
                <div class="modal-footer">
                    <button id="startStrategyData"
                            type="button"
                            class="btn btn-primary"
                            th:value="${startStrategyData}"
                            onclick="startStrategy($('#startStrategyData').val())">确定</button>
                    <button type="button" data-dismiss="modal" class="btn btn-danger">取消</button>
                </div>
            </div>
        </div>
    </div>

    <div id="modal-changeFavName" class="modal fade">
        <div class="modal-dialog" id="generateStrategy" th:fragment="generateStrategy">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" data-dismiss="modal" class="close">
                        <span>&times;</span>
                    </button>
                    <h4 id="strategyTarget" class="modal-title">设置策略执行目标</h4>
                </div>
                <form id="generateStrategyForm" data-parsley-validate="true" onsubmit="return false">
                    <div class="modal-body">
                        <div id="updateErrorMsg" class="alert alert-danger text-center" style="display:none;"></div>
                        <div class="form-group has-feedback" th:each="paramName : ${basicStrategyParamJson.keySet()}">
                            <label th:text="${basicStrategyParamJson.get(paramName).get('key')}"></label>
                            <select th:name="${paramName}"
                                    class="form-control ng-valid ng-not-empty ng-touched ng-dirty ng-valid-parse">
                                <option id="name"
                                        th:each="optionValue : ${basicStrategyParamJson.get(paramName).get('value')}"
                                        th:value="${optionValue}"
                                        th:text="${optionValue}"></option>
                            </select>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="submit"
                                id="updateFavoritesBtn"
                                class="btn btn-block btn-primary mt-lg"
                                th:value="${name}"
                                onclick="generateStrategy($('#updateFavoritesBtn').val())">
                            生成策略
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div id="modal-loginTips" class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" data-dismiss="modal" class="close">
                        <span>&times;</span>
                    </button>
                    <h4 class="modal-title">请登录</h4>
                </div>
                <div class="modal-body">
                    <p>您还没有登录，请先 <a href="/login" class="btn btn-primary btn-sm">登录</a> 或 <a href="/register"
                                                                                             class="btn btn-default btn-sm">注册</a>
                    </p>
                </div>
                <div class="modal-footer">
                    <button type="button" data-dismiss="modal" class="btn btn-danger">取消</button>
                </div>
            </div>
        </div>
    </div>
    <div id="modal-ChangePass" class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" data-dismiss="modal" class="close">
                        <span>&times;</span>
                    </button>
                    <h4 class="modal-title">修改密码</h4>
                </div>
                <form id="updatePwdForm" data-parsley-validate="true" onsubmit="return false">
                    <div class="modal-body">
                        <div class="alert alert-danger text-center" id="passwordError">密码输入错误</div>
                        <div class="form-group has-feedback">
                            <input id="oldPassword" name="oldPassword" type="password" placeholder="旧密码"
                                   class="form-control"
                                   v-model="password" required="required" data-parsley-required-message="请输入旧密码"/>
                            <span class="fa fa-lock form-control-feedback text-muted"></span>
                        </div>
                        <div class="form-group has-feedback">
                            <input id="newPassword" name="newPassword" type="password" placeholder="新密码"
                                   class="form-control"
                                   v-model="password" required="required" data-parsley-required-message="请输入新密码"
                                   pattern="/^(?![0-9]+$)(?![a-zA-Z]+$)(?![^0-9a-zA-Z]+$)\S{6,20}$/"
                                   data-parsley-pattern-message="请输入6-20位字母数字组合"/>
                            <span class="fa fa-lock form-control-feedback text-muted"></span>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="submit" id="updatePwdBtn" class="btn btn-block btn-primary mt-lg"
                                onclick="updatePwd();">确定
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div id="modal-changeDescription" class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" data-dismiss="modal" class="close">
                        <span>&times;</span>
                    </button>
                    <h4 class="modal-title">修改个人简介</h4>
                </div>
                <form id="updateIntroductionForm" data-parsley-validate="true" onsubmit="return false">
                    <div class="modal-body">
                        <div class="form-group">
              <textarea name="introduction" id="introduction" class="form-control" cols="30" rows="2"
                        required="required" data-parsley-error-message="请输入个人简介"></textarea>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="submit" id="updateIntroductionBtn" class="btn btn-block btn-primary mt-lg"
                                onclick="updateIntroduction();">确定
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div id="modal-ChangeNickname" class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" data-dismiss="modal" class="close">
                        <span>&times;</span>
                    </button>
                    <h4 class="modal-title">修改昵称</h4>
                </div>
                <form id="updateNicknameForm" data-parsley-validate="true" onsubmit="return false">
                    <div class="modal-body">
                        <div class="alert alert-danger text-center" id="nicknameError"></div>
                        <div class="form-group has-feedback">
                            <input id="newNickname" name="newNickname" type="text" placeholder="新昵称"
                                   class="form-control"
                                   required="required" data-parsley-error-message="请输入新昵称"/>
                            <span class="fa fa-user form-control-feedback text-muted"></span>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="submit" id="updateNicknameBtn" class="btn btn-block btn-primary mt-lg"
                                onclick="updateNickname();">确定
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div id="modal-letter" class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" data-dismiss="modal" class="close">
                        <span>&times;</span>
                    </button>
                    <h4 class="modal-title">给TA发私信</h4>
                </div>
                <form id="sendLetterForm" data-parsley-validate="true" onsubmit="return false">
                    <div class="modal-body">
                        <div class="form-group">
              <textarea id="letterContent" class="form-control" rows="3" required="required" placeholder="请输入内容！"
                        data-parsley-error-message="请输入内容！"> </textarea>
                        </div>
                        <!--<div class="btn btn-primary btn-block" onclick="sendLetter('original');">发送</div>-->
                        <button id="sendLetterBtn" type="submit" class="btn btn-primary btn-block"
                                onclick="sendLetter('original','','');">发送
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <input type="hidden" id="layoutConfigId" name="layoutConfigId"/>
</div>
</body>
</html>

